package com.inlycat.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.Min;
import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author jarvan4dev@163.com
 * @since 2015年8月12日下午1:22:32 影片实体类
 */

// json转换的时候，用于过滤null字段
// @JsonInclude(Include.NON_NULL)
public class Video implements Serializable {

	private static final long serialVersionUID = -945673142461655959L;

	private Long id;

	@NotBlank(message = "{video.name.notNull}")
	@Length(max = 15, message = "{video.name.length}")
	private String name;

	/**
	 * 影片的标签
	 */
	@NotBlank(message = "{video.label.notBlank}")
	@Length(max = 5, message = "{video.label.length}")
	private String label;

	@Length(max = 100, message = "{video.describle.length}")
	private String describle;

	/**
	 * 上传者
	 */
	private UserInfo uper;

	@Min(value = 0, message = "{video.charge.min}")
	private Integer charge;

	private Boolean hasBranch;

	private boolean processing;

	public boolean isProcessing() {
		return processing;
	}

	public void setProcessing(boolean processing) {
		this.processing = processing;
	}

	@Past(message = "{video.createTime.past}")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	// 格式化日期
	private Date createTime;

	@Past(message = "{video.updateTime.past}")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	// 格式化日期
	private Date updateTime;

	private VideoAttr videoAttr;

	/**
	 * 影片责任人
	 */
	private List<VideoResp> videoResps;

	/**
	 * 影片弹幕
	 */
	private List<Barrage> barrages;

	/**
	 * 影评
	 */
	private List<Comment> comments;

	/**
	 * 显示当前用户是否已收藏该电影
	 */
	private Boolean hasStore;

	/**
	 * 显示当前用户是否已赞该电影
	 */
	private Boolean hasThumb;

	/**
	 * 显示当前用户是否已踩该电影
	 */
	private Boolean hasTramp;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getDescrible() {
		return describle;
	}

	public void setDescrible(String describle) {
		this.describle = describle;
	}

	public UserInfo getUper() {
		return uper;
	}

	public void setUper(UserInfo uper) {
		this.uper = uper;
	}

	public Integer getCharge() {
		return charge;
	}

	public void setCharge(Integer charge) {
		this.charge = charge;
	}

	public Boolean getHasBranch() {
		return hasBranch;
	}

	public void setHasBranch(Boolean hasBranch) {
		this.hasBranch = hasBranch;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public VideoAttr getVideoAttr() {
		return videoAttr;
	}

	public void setVideoAttr(VideoAttr videoAttr) {
		this.videoAttr = videoAttr;
	}

	public List<VideoResp> getVideoResps() {
		return videoResps;
	}

	public void setVideoResps(List<VideoResp> videoResps) {
		this.videoResps = videoResps;
	}

	public List<Barrage> getBarrages() {
		return barrages;
	}

	public void setBarrages(List<Barrage> barrages) {
		this.barrages = barrages;
	}

	public List<Comment> getComments() {
		return comments;
	}

	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}

	public Boolean getHasStore() {
		return hasStore;
	}

	public void setHasStore(Boolean hasStore) {
		this.hasStore = hasStore;
	}

	public Boolean getHasThumb() {
		return hasThumb;
	}

	public void setHasThumb(Boolean hasThumb) {
		this.hasThumb = hasThumb;
	}

	public Boolean getHasTramp() {
		return hasTramp;
	}

	public void setHasTramp(Boolean hasTramp) {
		this.hasTramp = hasTramp;
	}

	@Override
	public String toString() {
		return "Video [id=" + id + ", name=" + name + ",label=" + label
				+ ", describle=" + describle + ", uper=" + uper + ", charge="
				+ charge + ", hasBranch=" + hasBranch + ", createTime="
				+ createTime + ", updateTime=" + updateTime + ", videoAttr="
				+ videoAttr + ", videoResps=" + videoResps + ", barrages="
				+ barrages + ", comments=" + comments + ", hasStore="
				+ hasStore + ", hasThumb=" + hasThumb + ", hasTramp="
				+ hasTramp + "]";
	}

}
